#include <iostream>
#include "time.h"

Time::Time()
{
    hours = 0;
    minuts = 0;
};
Time::Time(int h,int m)
{
    hours = h;
    minuts = m;
};
void Time::addhour(int h)
{
    hours += h;
    hours = hours%12;
};
void Time::addmin(int m)
{
    minuts += m;
    int h = minuts/60;
    if(h!=0)
    {
            hours += 1;
            minuts = minuts%60;
    }
};
void Time::reset(int h,int m)
{
    hours = h;
    minuts = m;
}
void Time::show() const
{
    using std::cout;
    cout<<"Hour: "<<hours<<" Minuts: "<<minuts<<"\n";
}
Time Time::sum(Time const &t) const
{
    Time sum;
    sum.minuts = minuts + t.minuts;
    sum.hours = hours + t.hours+sum.minuts/60;
    sum.minuts %= 60;
    return sum;
}
